//
// Created by liushuai on 2020/1/31.
//
#include "twoSum.h"
<<<<<<< HEAD:cxx/algorithm/src/twoSum.cc
vector<int> twoSum(vector<int>& nums, int target){
    int length = nums.size();
    vector<int> result;
    for(int i = 0;i<length;i++){

            result.push_back(i);
            for(int j=i+1;j<length;j++){
                if(nums.at(j) == target-nums.at(i)){
                    result.push_back(j);
                    return result;
                }
            }
            result.pop_back();
        }

    return result;
=======
vector<int> twoSum(vector<int>& nums, int target) {
  int length = nums.size();
  vector<int> result;
  for (int i = 0; i < length; i++) {
    result.push_back(i);
    for (int j = i + 1; j < length; j++) {
      if (nums.at(j) == target - nums.at(i)) {
        result.push_back(j);
        return result;
      }
    }
    result.pop_back();
  }

  return result;
>>>>>>> dev:cxx/algorithm/common/src/twoSum.cc
}
